package Testing;

import GameEngine.GameConstants.Thing;
import GameEngine.Level;
import GameEngine.Vector;
import Objects.GameObject;

/**
 *
 * @author mhfowler
 */
public class TestCollisions {

    /* main method bitches */
    public static void main(String[] args) {



        // shouldn't collide
        GameObject obj1 = GameEngine.LevelInitializer.objectConstructor(Thing.PLAYER, new Vector(1, 0), new Vector(300, 300), new Vector(50, 50));
        GameObject obj2 = GameEngine.LevelInitializer.objectConstructor(Thing.WALL, new Vector(1, 0), new Vector(300, 400), new Vector(500, 5));
        System.out.println("shouldn't collide: " + (Level.checkCollision(obj1, obj2) != null));

        // should definitely not collide
        GameObject obj3 = GameEngine.LevelInitializer.objectConstructor(Thing.PLAYER, new Vector(1, 0), new Vector(800, 300), new Vector(50, 50));
        GameObject obj4 = GameEngine.LevelInitializer.objectConstructor(Thing.WALL, new Vector(1, 0), new Vector(300, 400), new Vector(500, 5));
        System.out.println("shouldn't collide: " + (Level.checkCollision(obj3, obj4) != null));


        // should not collide
        GameObject obj5 = GameEngine.LevelInitializer.objectConstructor(Thing.PLAYER, new Vector(1, 0), new Vector(10, 10), new Vector(4, 4));
        GameObject obj6 = GameEngine.LevelInitializer.objectConstructor(Thing.WALL, new Vector(1, 0), new Vector(16, 16), new Vector(1, 1));
        System.out.println("shouldn't collide:  " + (Level.checkCollision(obj5, obj6) != null));

        // should collide
        System.out.println("new collision");
        GameObject obj7 = GameEngine.LevelInitializer.objectConstructor(Thing.PLAYER, new Vector(1, 0), new Vector(10, 10), new Vector(10, 10));
        GameObject obj8 = GameEngine.LevelInitializer.objectConstructor(Thing.WALL, new Vector(1, 0), new Vector(16, 16), new Vector(3, 3));
        System.out.println("obj7 corners >");
        for (Vector c : obj7.getCorners()) {
            System.out.println("corn: " + c.toString());
        }
        System.out.println("obj8 corners >");
        for (Vector c : obj8.getCorners()) {
            System.out.println("corn: " + c.toString());
        }
        System.out.println("collided: " + (Level.checkCollision(obj7, obj8) != null));


        // should not collide
        System.out.println("new collision");
        GameObject obj9 = GameEngine.LevelInitializer.objectConstructor(Thing.PLAYER, new Vector(1, 0), new Vector(300, 300), new Vector(50, 50));
        GameObject obj10 = GameEngine.LevelInitializer.objectConstructor(Thing.WALL, new Vector(1, 0), new Vector(300, 400), new Vector(500, 10));
        System.out.println("obj9 corners >");
        for (Vector c : obj9.getCorners()) {
            System.out.println("corn: " + c.toString());
        }
        System.out.println("obj10 corners >");
        for (Vector c : obj10.getCorners()) {
            System.out.println("corn: " + c.toString());
        }
        System.out.println("shouldn't collide:  " + (Level.checkCollision(obj9, obj10) != null));

    }
}
